<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend_Text_Figlet - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.text.figlet.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.text.figlet.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.text.html">Zend_Text</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.text.html">Zend_Text</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.text.table.introduction.html">Zend_Text_Table</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.text.figlet" class="section"><div class="info"><h1 class="title">Zend_Text_Figlet</h1></div>
    

    <p class="para">
        <span class="classname">Zend_Text_Figlet</span> is a component which enables developers to
        create a so called FIGlet text. A FIGlet text is a string, which is
        represented as <acronym class="acronym">ASCII</acronym> art. FIGlets use a special font format, called
        FLT (FigLet Font). By default, one standard font is shipped with
        <span class="classname">Zend_Text_Figlet</span>, but you can download additional fonts at
        <a href="http://www.figlet.org/fontdb.cgi" class="link external">&raquo; http://www.figlet.org</a>.
    </p>

    <blockquote class="note"><p><b class="note">Note</b>: <span class="info"><b>Compressed fonts</b><br /></span>
        

        <p class="para">
            <span class="classname">Zend_Text_Figlet</span> supports gzipped fonts. This means that
            you can take an <var class="filename">.flf</var> file and gzip it. To allow
            <span class="classname">Zend_Text_Figlet</span> to recognize this, the gzipped font
            must have the extension <var class="filename">.gz</var>. Further, to be able to use
            gzipped fonts, you have to have enabled the GZIP extension of <acronym class="acronym">PHP</acronym>.
        </p>
    </p></blockquote>

    <blockquote class="note"><p><b class="note">Note</b>: <span class="info"><b>Encoding</b><br /></span>
        

        <p class="para">
            <span class="classname">Zend_Text_Figlet</span> expects your strings to be UTF-8 encoded
            by default. If this is not the case, you can supply the character
            encoding as second parameter to the  <span class="methodname">render()</span> method.
        </p>
    </p></blockquote>

    <p class="para">
        You can define multiple options for a FIGlet. When instantiating
        <span class="classname">Zend_Text_Figlet</span>, you can supply an array or an instance of
        <span class="classname">Zend_Config</span>.

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    <span class="property">font</span> - Defines the font which should be used
                    for rendering. If not defines, the built-in font will be
                    used.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="property">outputWidth</span> - Defines the maximum width of the
                    output string. This is used for word-wrap as well as
                    justification. Beware of too small values, they may result
                    in an undefined behaviour. The default value is 80.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="property">handleParagraphs</span> - A boolean which indicates,
                    how new lines are handled. When set to <b><tt>TRUE</tt></b>, single new
                    lines are ignored and instead treated as single spaces. Only multiple
                    new lines will be handled as such. The default value is
                    <b><tt>FALSE</tt></b>.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="property">justification</span> - May be one of the values of
                    <span class="classname">Zend_Text_Figlet::JUSTIFICATION_*</span>. There is
                    <b><tt>JUSTIFICATION_LEFT</tt></b>,
                    <b><tt>JUSTIFICATION_CENTER</tt></b> and
                    <b><tt>JUSTIFICATION_RIGHT</tt></b> The default justification
                    is defined by the <span class="property">rightToLeft</span> value.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="property">rightToLeft</span> - Defines in which direction the
                    text is written. May be either
                    <b><tt>Zend_Text_Figlet::DIRECTION_LEFT_TO_RIGHT</tt></b> or
                    <b><tt>Zend_Text_Figlet::DIRECTION_RIGHT_TO_LEFT</tt></b>. By
                    default the setting of the font file is used. When justification
                    is not defined, a text written from right-to-left is
                    automatically right-aligned.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <span class="property">smushMode</span> - An integer bitfield which defines,
                    how the single characters are smushed together. Can be the
                    sum of multiple values from <span class="classname">Zend_Text_Figlet::SM_*</span>.
                    There are the following smush modes: SM_EQUAL, SM_LOWLINE,
                    SM_HIERARCHY, SM_PAIR, SM_BIGX, SM_HARDBLANK, SM_KERN and
                    SM_SMUSH. A value of 0 doesn&#039;t disable the entire smushing,
                    but forces SM_KERN to be applied, while a value of -1 disables
                    it. An explanation of the different smush modes can be found
                    <a href="http://www.jave.de/figlet/figfont.txt" class="link external">&raquo; here</a>.
                    By default the setting of the font file is used. The smush mode
                    option is normally used only by font designers testing the various
                    layoutmodes with a new font.
                </p>
            </li>
        </ul>
    </p>

    <div class="example" id="zend.text.figlet.example.using"><div class="info"><p><b>Example #1 Using Zend_Text_Figlet</b></p></div>
        

        <div class="example-contents"><p>
            This example illustrates the basic use of <span class="classname">Zend_Text_Figlet</span>
            to create a simple FIGlet text:
        </p></div>

        <pre class="programlisting brush: php">
$figlet = new Zend_Text_Figlet();
echo $figlet-&gt;render(&#039;Zend&#039;);
</pre>


        <div class="example-contents"><p>
            Assuming you are using a monospace font, this would look as follows:
        </p></div>

        <pre class="programlisting brush: text">
  ______    ______    _  __   ______
 |__  //   |  ___||  | \| || |  __ \\
   / //    | ||__    |  &#039; || | |  \ ||
  / //__   | ||___   | .  || | |__/ ||
 /_____||  |_____||  |_|\_|| |_____//
 `-----`&#039;  `-----`   `-` -`&#039;  -----`
</pre>

    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.text.html">Zend_Text</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.text.html">Zend_Text</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.text.table.introduction.html">Zend_Text_Table</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="reference.html">Refer&ecirc;ncia do Zend Framework</a></li>
  <li class="header up"><a href="zend.text.html">Zend_Text</a></li>
  <li class="active"><a href="zend.text.figlet.html">Zend_Text_Figlet</a></li>
  <li><a href="zend.text.table.introduction.html">Zend_Text_Table</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>